<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/2/17 0017
 * Time: 1:00
 */

namespace app\validate;


use think\Validate;

class ValidateBase extends Validate
{
    protected function checkPhone($value)
    {
        if(!preg_match("/^1[34578]\d{9}$/", $value)){
            return '手机格式错';
        }
        return true;
    }

    protected function checkEMail($value){
        $preg_email='/^[a-zA-Z0-9]+([-_.][a-zA-Z0-9]+)*@([a-zA-Z0-9]+[-.])+([a-z]{2,5})$/ims';
        if(!preg_match($preg_email,$value)){
            return '邮箱格式错误';
        }
        return true;
    }
}